import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
 
const CounterApp = () => {
  const dispatch = useDispatch();
  const counter = useSelector(state => state.counter);
 
  const handleIncrement = () => {
    dispatch({ type: 'INCREMENT' });
  };
 
  const handleDecrement = () => {
    dispatch({ type: 'DECREMENT' });
  };
 
  return (
    <div>
      <p>Counter: {counter}</p>
      <button onClick={handleIncrement}>Increment</button>
      <button onClick={handleDecrement}>Decrement</button>
    </div>
  );
};
 
export default CounterApp;